/*
The MIT License (MIT)

Copyright (c) 2014 Bert Wierenga

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "hhdGfxTypes.h"

namespace hhd
{
	GfxTexture2DFormat GfxTexture2DFormatFromString( const String& in_string )
	{
		     if (String::equals(in_string, "R8G8B8A8_INT")) return T2DF_R8G8B8A8_INT;
		else if (String::equals(in_string, "R8G8B8A8_UINT")) return T2DF_R8G8B8A8_UINT;
		else if (String::equals(in_string, "R8G8B8A8")) return T2DF_R8G8B8A8;
		else if (String::equals(in_string, "R16G16B16A16_INT")) return T2DF_R16G16B16A16_INT;
		else if (String::equals(in_string, "R16G16B16A16_UINT")) return T2DF_R16G16B16A16_UINT;
		else if (String::equals(in_string, "R16G16B16A16")) return T2DF_R16G16B16A16;
		else if (String::equals(in_string, "R16")) return T2DF_R16;
		else if (String::equals(in_string, "R24")) return T2DF_R24;
		else if (String::equals(in_string, "R24G8")) return T2DF_R24G8;
		else if (String::equals(in_string, "R32")) return T2DF_R32;
		else if (String::equals(in_string, "R32G8")) return T2DF_R32G8;
		else if (String::equals(in_string, "D16")) return T2DF_D16;
		else if (String::equals(in_string, "D24")) return T2DF_D24;
		else if (String::equals(in_string, "D24S8")) return T2DF_D24S8;
		else if (String::equals(in_string, "D32")) return T2DF_D32;
		else if (String::equals(in_string, "D32S8")) return T2DF_D32S8;

		HHD_ASSERT(!"Failed to find a match for Render Target format.");
		return T2DF_R8G8B8A8;
	}
}